package com.zyz.job.model.exam;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zyz.common.core.model.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@TableName(value = "tb_user_exam")
public class UserExam extends BaseEntity {
    /*
create table tb_user_exam (
    user_exam_id bigint unsigned not null comment '用户竞赛关系id(主键)',
    user_id bigint unsigned not null comment '用户id',
    exam_id bigint unsigned not null comment '竞赛id',
    score int unsigned comment '竞赛得分',
    exam_rank int unsigned comment '竞赛排名',
    create_by bigint unsigned not null comment '创建人',
    create_time datetime not null default now() comment '创建时间',
    update_by bigint unsigned comment '更新人',
    update_time datetime comment '更新时间',

    primary key (user_exam_id)
);
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long userExamId; // 用户竞赛关系id(主键)

    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;  // 用户id

    @JsonSerialize(using = ToStringSerializer.class)
    private Long examId;  // 竞赛id

    private Integer score;  // 竞赛得分

    private Integer examRank;  // 竞赛排名


}
